﻿using System;
using System.Collections.Generic;
using System.Text;
using Castle.ActiveRecord;
using System.Collections;
using System.Data;
using Castle.ActiveRecord.Queries;
using System.ComponentModel;

namespace Mang24k99.Model.COMM
{
    [ActiveRecord("KT_COMM_CODELIST_History")]
    public class MKtCommCodelistHistory : ActiveRecordBase
    {
        #region Model

        private int _id;
        private int? _code_no;
        private string _code_cname;
        private string _code_ename;
        private MKtCommCodeType _MKtCommCodeType;
        private string _code_comments;
        private int? _is_validate;
        private DateTime? _input_time;
        private DateTime? _modify_time;
        private DateTime? _delete_time;



        /// <summary>
        /// 主键ID
        /// </summary>
        [PrimaryKey(PrimaryKeyType.Native, "ID")]
        public int ID
        {
            set { _id = value; }
            get { return _id; }
        }

        /// <summary>
        /// 代码编号
        /// </summary>
        [Property("CODE_NO")]
        public int? CODE_NO
        {
            set { _code_no = value; }
            get { return _code_no; }
        }

        /// <summary>
        ///代码中文名称 
        /// </summary>
        [Property("CODE_CNAME")]
        public string CODE_CNAME
        {
            set { _code_cname = value; }
            get { return _code_cname; }
        }

        /// <summary>
        ///代码英文名称 
        /// </summary>
        [Property("CODE_ENAME")]
        public string CODE_ENAME
        {
            set { _code_ename = value; }
            get { return _code_ename; }
        }

        /// <summary>
        /// 类型编码
        /// </summary>
        [BelongsTo("TYPE_CODE")]
        public MKtCommCodeType MKtCommCodeType
        {
            set { _MKtCommCodeType = value; }
            get { return _MKtCommCodeType; }
        }

        /// <summary>
        /// 备注
        /// </summary>
        [Property("CODE_COMMENTS")]
        public string CODE_COMMENTS
        {
            set { _code_comments = value; }
            get { return _code_comments; }
        }

        /// <summary>
        ///是否有效：0——使用（有效），1——禁用（失效） 
        /// </summary>
        [Property("IS_VALIDATE")]
        public int? IS_VALIDATE
        {
            set { _is_validate = value; }
            get { return _is_validate; }
        }

        /// <summary>
        /// 输入时间
        /// </summary>
        [Property("INPUT_TIME")]
        public DateTime? INPUT_TIME
        {
            set { _input_time = value; }
            get { return _input_time; }
        }
        /// <summary>
        /// 修改时间
        /// </summary>
        [Property("MODIFY_TIME")]
        public DateTime? MODIFY_TIME
        {
            set { _modify_time = value; }
            get { return _modify_time; }
        }

        /// <summary>
        ///删除时间 
        /// </summary>
        [Property("DELETE_TIME")]
        public DateTime? DELETE_TIME
        {
            set { _delete_time = value; }
            get { return _delete_time; }
        }

        #endregion Model

        public static IList<MKtCommCodelistHistory> SelectAll()
        {
            return (IList<MKtCommCodelistHistory>)FindAll(typeof(MKtCommCodelistHistory));
        }
        public static MKtCommCodelistHistory SelectByPrimaryKey(object ID)
        {
            return (MKtCommCodelistHistory)FindByPrimaryKey(typeof(MKtCommCodelistHistory), ID);
        }
        public static IList<MKtCommCodelistHistory> SelectALLByProperty(string property, object value)
        {
            return (IList<MKtCommCodelistHistory>)FindAllByProperty(typeof(MKtCommCodelistHistory), property, value);
        }
        public static IList<MKtCommCodelistHistory> SelectALLSliced(int firstResult, int maxResult, NHibernate.Expression.DetachedCriteria criteria)
        {

            return (IList<MKtCommCodelistHistory>)SlicedFindAll(typeof(MKtCommCodelistHistory), firstResult, maxResult, criteria);
        }
    }
}